import { ResourceManager } from "./ResourceManager";
import { FileType } from "./FileType";
import { ResourceInfo } from "info/ResourceInfo";
import { LoaderManager } from "./LoaderManager";
type int = number;
//class SpecialLoaderManager
    
    export  class SpecialLoaderManager
    {
       

        public static Load(arg1: string, arg2: string, arg3: Function, arg4: int=3, arg5: Object=null, arg6: Function=null, arg7: Function=null): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            if (ResourceManager.hasInfoByName(arg1)) 
            {
                loc1 = ResourceManager.getInfoByName(arg1);
            }
            else 
            {
                loc3 = arg2.split(".");
                loc4 = loc3[(loc3.length - 1)];
                loc4 = "." + loc4.toLocaleUpperCase();
                (loc5 = new Object()).type = loc4;
                loc5.name = arg1;
                loc5.time = Math.random().toString();
                loc5.path = arg2;
                if (loc2 = FileType.getLoaderInfoByType(loc5.type as string)) 
                {
                    loc1 = new loc2(loc5);
                }
                else 
                {
                    loc1 = new ResourceInfo(loc5);
                }
                loc1.loaclPath = loc1.path;
                ResourceManager.addResource(loc1);
            }
            LoaderManager.instance.load(arg1, arg3, arg4, arg5, arg6, arg7);
            return;
        }
    }
